import apiUrl from '../base'
import axios from '@/libs/axios'

const riskIdentification = {
  queryList(data) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/list`,
      data,
      method: 'post'
    })
  },
  save(data) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/add`,
      data,
      method: 'post'
    })
  },
  edit(data) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/edit`,
      data,
      method: 'post'
    })
  },
  process(id) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/detail/process/${id}`,
      method: 'get'
    })
  },
  remove(id) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/delete/${id}`,
      method: 'delete'
    })
  },
  batchRemove(data) {
    return axios.request({
      url: `${apiUrl.risk}v1/RiskOrder/batchDelete`,
      method: 'delete',
      data
    })
  },
  queryProjectsForBusiness() {
    return axios.request({
      url: `${apiUrl.base}v1/Project/getByUser`,
      method: 'get'
    })
  },
  //根据机构获取项目
  getByOrgTreeObjectIdcc(id) {
    return axios.request({
      url: `${apiUrl.base}v1/Project/getByOrgTreeObjectId/${id}`,
      method: 'get'
    })
  },
  judgeDispatch() {
    return axios.request({
      url: `${apiUrl.risk}v1/DispatchPost/checkDispatchPostForToken`,
      method: 'get'
    })
  },
  queryRiskByType(id) {
    return axios.request({
      url: `${apiUrl.risk}v1/riskInfoLib/listByRiskTypeId?riskTypeId=${id}`,
      method: 'get'
    })
  },
  queryRiskByTypes(data) {
    return axios.request({
      url: `${apiUrl.risk}v1/riskInfoLib/listByRiskTypeIds`,
      method: 'post',
      data
    })
  }
}
export default riskIdentification
